<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<div id="Top">
	<div class="tops"></div>
	<div class=" block header_bg" style="margin-bottom: 0px;">
		<div class="top_nav_header">
			<div class="top_nav">
				<div class="block">
					<div class="f_l left_login">
						<script type="text/javascript" src="js/transport.js"></script>
						<script type="text/javascript" src="js/utils.js"></script>
						<font id="ECS_MEMBERZONE"> 欢迎<font
							style="font-size: 20px; color: red;">${loginuser.nickname }</font>光临本店&nbsp;&nbsp;
							<c:if test="${loginuser eq null }">
								<a href="login.jsp">登录</a>
								<a href="register.jsp">注册</a>
							</c:if> <c:if test="${loginuser ne null }">
							
								&nbsp; <a href="${path}/logout.jsp">退出</a>

							</c:if>
						</font>
					</div>
					<ul class="top_bav_l">
						<li class="top_sc">&nbsp;&nbsp;<a href="javascript:void(0);"
							onclick="AddFavorite('我的网站',location.href)">收藏本站</a></li>
						<li>&nbsp;&nbsp;&nbsp;关注我们：</li>
						<li style="border: none" class="menuPopup"
							onMouseOver="sw_nav(1,1);" onMouseOut="sw_nav(1,0);"><a
							id="HandleLI_1" href="javascript:;" title="微博" class="attention"></a>
							<div id=DisSub_1 class="top_nav_box top_weibo">
								<a href="http://weibo.com/itcast?is_hot=1" target="_blank"
									title="新浪微博" class="top_weibo"></a> <a
									href="http://t.qq.com/myjayen" target="_blank" title="QQ微博"
									class="top_qq"></a>
							</div></li>
						<li class="menuPopup" onMouseOver="sw_nav(2,1);"
							onMouseOut="sw_nav(2,0);"><a id="HandleLI_2"
							href="javascript:;" title="微信" class="top_weixin"></a>
							<div id="DisSub_2" class="weixinBox" style="display: none;">
								<table width="100%" cellpadding=0 cellspacing=0 align="center">
									<tr>
										<td><img src="images/wx_cz.jpg"
											style="width: 90px; height: 90px; background: #0000CC"
											width="90" height="90"></td>
										<td><img src="images/wx_hm.jpg"
											style="width: 90px; height: 90px; background: #0000CC"
											width="90" height="90"></td>
									</tr>
									<tr>
										<td>天狗官方微信</td>
										<td>程序员官方微信</td>
									</tr>
								</table>
							</div></li>
					</ul>
					<div class="header_r">
						<a href="${path}/orders?method=query">我的订单</a> <a href="${path}/goods?method=query">商品列表</a>
					</div>
				</div>
			</div>
		</div>
		<div class="clear_f"></div>
		<div class="header_top logo_wrap clearfix">
			<a class="logo_new" href="javascript:;"> <!-- <img src="themes/ecmoban_jumei/images/logo.gif" /> -->
				<img src="images/1111.png" style="width: 352px;height: 73px;"/>
			</a>
			<div class="ser_n">
				<form id="searchForm" class="searchBox clearfix" name="searchForm"
					onsubmit="return false;" method="get" action="">
					<span class="ipt1"><input name="keywords"
						placeholder="请输入您想购买的商品" type="text" id="keyword" value=""
						class="searchKey" /></span> <span class="ipt2">
						<input id="searchbyname"  type="button" name="imageField" class="fm_hd_btm_shbx_bttn"
						value="搜  索"></span>
				</form>
					<script type="text/javascript">
						jQuery(function ($) {
							$("#searchbyname").click(function () {
								location = "${path}/goods?method=query&name="+$("#keyword").val();
							});
						});
					</script>	
				<div class="clear_f"></div>
				<ul class="searchType none_f"></ul>
			</div>
			<ul class="cart_info">
				<li id="ECS_CARTINFO">
					<div class="top_cart">
						<img src="themes/ecmoban_jumei/images/cart.gif" /> <span
							class="carts_num none_f"><a  id="goodsnum"  href="${path}/cart?method=query" title="查看购物车">0</a></span>
						<a href="${path}/cart?method=query" class="shopborder">去购物车结算</a>
					</div>
				</li>
			</ul>
		</div>
	</div>
</div>
<div style="clear: both"></div>
<div class="menu_box clearfix">
	<div class="block" style="width: 840px" id="category">
		<a href="index.jsp" class="cur">首页</a>
		<!-- <a href="javascript:;">化妆品</a>
		<a href="javascript:;">鞋包配饰</a> 
		<a href="javascript:;">居家母婴</a> 
		<ahref="javascript:;">服饰内衣</a>
		 <a href="javascript:;">团购商品</a> -->
	</div>
</div>
<script type="text/javascript">
	jQuery(function($) {
		
		$.ajax({
			url : "${path}/cart",
			type : "post",
			data : {
				method : "querynum"
			},
			dataType : "json",
			success : function(result) {
				$("a#goodsnum").text(result.length);
			}
		});
	//为了提高响应的速度，分类数据使用异步加载
		$.ajax({
			url : "${path}/goods",
			type : "post",
			data : {method : "category"},
			dataType : "json",
			success : function(result) {
				$(result).each(function() {
					$("<a></a>", {
						href : "javascript:;",
						text : this.name,
						cid : this.id,// 标签的属性(自定义)
						// 创建元素的同时，进行事件绑定
						click : function() {
							var cid = $(this).attr("cid");
							location = "${path}/goods?method=query&cid=" + cid;
						}
					}).appendTo($("#category"));
				});
				// 给当前的类别添加红色背景
				// 通过el中的内置对象param.参数名，获取参数
				$("#category a[cid=${param.cid}]").attr("class", "cur")
					// 找到所有的兄弟,移除cur样式
						.siblings().removeClass("cur");
			}
		});
	});
</script>
<link href="themes/ecmoban_qq/images/qq.css" rel="stylesheet"
	type="text/css" />
<div class="QQbox" id="divQQbox" style="width: 170px;">
	<div class="Qlist" id="divOnline" onmouseout="hideMsgBox(event);"
		style="display: none;" onmouseover="OnlineOver();">
		<div class="t"></div>
		<div class="infobox">
			我们营业的时间<br>9:00-18:00
		</div>
		<div class="con">
			<ul>
				<li><a href="javascript:;" target="_blank"><img
						src="images/button_old_41.gif" height="16" border="0" alt="QQ" />&nbsp;&nbsp;666666666</a></li>
				<li><a href="javascript:;" target="_blank"><img
						src="images/button_old_41.gif" height="16" border="0" alt="QQ" />&nbsp;&nbsp;888888888</a></li>
				<li><a href="javascript:;" target="_blank"><img
						src="images/button_old_41.gif" height="16" border="0" alt="QQ" />&nbsp;&nbsp;999999999</a></li>
				<li>服务热线: 88888888</li>
			</ul>
		</div>
		<div class="b"></div>
	</div>
	<div id="divMenu" onmouseover="OnlineOver();" style="display: block;">
		<img src="themes/ecmoban_qq/images/qq_1.gif" class="press" alt="在线咨询">
	</div>
	<script type="text/javascript">
		//初始化主菜单
		function sw_nav(obj, tag) {
			var DisSub = document.getElementById("DisSub_" + obj);
			var HandleLI = document.getElementById("HandleLI_" + obj);
			if (tag == 1) {
				DisSub.style.display = "block";
			} else {
				DisSub.style.display = "none";
			}
		}
	</script>
</div>